home *** CD-ROM | disk | FTP | other *** search
/ MacHome 2001 June / MacHome Magazine Demo Disc June 2001.iso / Stuff / Software / Graphic / iView PhotoMover 2.0.3 / AppleScript samples / Application Class < prev    next >
Encoding:
Text File  |  2001-03-11  |  1.6 KB  |  68 lines  |  [TEXT/ToyS]

  1. tell application "iView PhotoMover"
  2.     
  3.     (* get/set properties *)
  4.     
  5.     get the name
  6.     get the version
  7.     get the frontmost
  8.     
  9.     -- Save current settings
  10.     set klog to get the Log
  11.     set ksound to get the Sound
  12.     set kdetails to get the Details
  13.     set khost to get the Host
  14.     
  15.     -- Settable options (note they are not saved when the program exits).
  16.     
  17.     set the Log to false -- All error message go to screen
  18.     set the Sound to false -- don't play sound at end of upload.
  19.     set the Details to true -- Set Details to true for tracking down problems.
  20.     set the Details to false
  21.     
  22.     (* function samples *)
  23.     
  24.     exists -- app is running
  25.     data size of name -- ie  "iView PhotoMover"
  26.     
  27.     -- Get a file to upload...
  28.     set afile to choose file
  29.     activate
  30.     
  31.     -- 0 = PhotoPoint
  32.     -- 1 = ClubPhoto
  33.     -- 2 = zing
  34.     -- 3 = ImageStation
  35.     -- 4 = NikonNet
  36.     -- 5 = FotoTime
  37.     set the Log to true -- save  result to log file...
  38.     
  39.     repeat with hostid from 0 to 5
  40.         set the Host to hostid
  41.         try
  42.             
  43.             --  set timeout to some large number
  44.             with timeout of 3600 seconds -- how long to upload? 1 hour?
  45.                 
  46.                 -- upload the image to the current site.
  47.                 open afile
  48.                 -- open t into album "test" with keyword "keyword" with description "test"
  49.                 
  50.                 -- Note: Currently no site have support for keywords and descriptions yet. this will be added
  51.                 -- as site vendors help us add this feature.
  52.             end timeout
  53.             
  54.         on error msg
  55.             display dialog msg & return & "Uploading to host index " & hostid
  56.         end try
  57.     end repeat
  58.     
  59.     -- restore the settings
  60.     set the Log to klog
  61.     set the Sound to ksound
  62.     set the Details to kdetails
  63.     set the Host to khost
  64.     
  65.     -- quit
  66.     
  67. end tell
  68.